// basicnpc.txt
// A very simple, naive text. Creature attacks anything it hates nearby.
// Once it has won, it returns to its home.
// Memory Cells:
//   Cell 0 - How creature moves.
//     0 - If 0, wander randomly. 
//     1 - Stands still until a target appears.
//     2 - Completely immobile, even if target appears.
//   Cell 1 - State to call when creature dies.
//   Cell 2 - group to add creature to.
//   Cell 3 - Dialogue node to start with if talked to. if left at 0, this
//     character doesn't talk.

beginterrainscript;

variables;

short i,target;

body;

beginstate INIT_STATE;
set_ter_script_mode(ME,3);
	break;

beginstate START_STATE; 
if(get_flag(get_memory_cell(4),get_memory_cell(5)) == get_memory_cell(6))
	run_town_script(get_memory_cell(3));
break;

beginstate 3; // attacking

break;

beginstate TALKING_STATE;

break;